package com.nova.bluetooth.xunFeiSDK.kugouMusic;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * 功能性函数扩展类
 */
public class FucUtil {

    /**
     * 手机号格式校验
     *
     * @param number
     * @return
     */
    public static boolean validatePhoneNumber(String number) {
        Pattern p = Pattern.compile("^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\\d{8}$");
        Matcher m = p.matcher(number);
        return m.matches();
    }

    /**
     * 验证短信验证码有效性
     */
    public static boolean validateSmscodeNum(String number) {
        Pattern p = Pattern.compile("\\d{6}");
        Matcher m = p.matcher(number);
        return m.matches();
    }

}
